#include "../src/StrmBMP.h"
#include <iostream>
#include <string>
#include <codecvt>
#include <locale>

int main()
{
  std::cout<<"File Head Define Size: "<<sizeof(FileHead)<<std::endl;
  std::cout<<"Please input file Path : ";
  std::wstring filePath;
  std::wcin>>filePath;
  iStrmBMP readFile(filePath);
  auto fileHead=readFile.GetFileHead();
  std::wstring_convert<std::codecvt_utf8_utf16<char16_t>,char16_t> conv;
  std::cout<<"FileName: "<<readFile.GetFileName()<<std::endl;
  std::wcout<<"HeadLength: "<<fileHead->HeadLength<<std::endl;
  std::wcout<<"DataBlockByte: "<<fileHead->DataBlockByte<<std::endl;
  std::wcout<<"PixelWidth: "<<fileHead->PixelWidth<<std::endl;
  std::wcout<<"PixelHeight: "<<fileHead->PixelHeight<<std::endl;
  std::cout<<"OperatorName: "<<conv.to_bytes(fileHead->OperatorName,fileHead->OperatorName+10)<<std::endl;
  std::cout<<"Gain: "<<readFile.GetGain()<<std::endl;
  BlockHead blockHead;
  unsigned char* imageData=new unsigned char[fileHead->PixelWidth*fileHead->PixelHeight];
  readFile.ReadImage(imageData,&blockHead);
  std::cout<<std::endl<<"First Image"<<std::endl;
  std::cout<<"FrameID: "<<blockHead.FrameNo<<std::endl;
  std::cout<<"FrameArrivalTime: "<<blockHead.FrameArrivalTime<<std::endl;
  std::cout<<"ArrivalMicrosecond: "<<blockHead.ArrivalMicrosecond<<std::endl;
  std::cout<<"DeviceTimeStamp: "<<blockHead.DeviceTimeStamp<<std::endl;
  return 0;
}
